// reducer定义
export default function reducer(state={
    menus:JSON.parse(localStorage.getItem("menus"))
},action){
    switch(action.type){
        // 匹配菜单
        case "initMenus":
            localStorage.setItem("menus",JSON.stringify(action.payload))
            return {...state,menus:action.payload}
        default:
            return state
    }
}